package com.yf1706.dao.jpa;

import java.util.Date;
import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.yf1706.bean.CheckMonthReport;
import com.yf1706.vo.CheckMonthReportVO;
/**
 * @author 锦涛
 */
public interface ICheckMonthReportJDAO extends JpaRepository<CheckMonthReport, Integer>{

	//根据发薪时间得到一个月的考勤数据
	@Query("select new com.yf1706.vo.CheckMonthReportVO(c.monthId, c.emp.empId,"
			+ " c.absenteeismNumber, c.lateNumber, c.earlyNumber, c.totalPayholiday,"
			+ " c.totalNopayholiday, c.totalWorkday, c.totalWeek, c.totalHoliday) from"
			+ " CheckMonthReport c where Year(c.salaryTime)=Year(?1) and"
			+ " Month(c.salaryTime)=Month(?1)")
	List<CheckMonthReportVO> queryAllBySmonth(Date countDate);
}
